package leetcode.code1400;

public class Solution {
	public boolean canConstruct(String s, int k) {
		int[] a = new int[26];
		for (int i = 0; i < s.length(); i++) {
			a[s.charAt(i) - 'a']++;
		}
		int n = 0;
		for (int i = 0; i < a.length; i++) {
			if ((a[i] & 1) == 1) {
				n++;
			}
		}
		int min = Math.max(n, 1);
		int max = s.length();
		return k >= min && k <= max;
	}
}
